<?
$tien_ich = array();
if (trim($txt_tien_ich) != '') 
	$tien_ich = explode(';',$txt_tien_ich);
	
$qti = $db->query("SELECT * FROM tgp_services_menu WHERE hien_thi = 1 ORDER BY thu_tu");
while ($rti = $db->fetch($qti))
{
?>
<tr class='tr_border'>
	<td align='right' valign="top"><div style='padding:10px'><b><?=$rti['ten']?></b></div></td>
	<td align='left'>
		<?
		$qtic = $db->query("SELECT * FROM tgp_services WHERE cat = '".$rti['id']."'");
		while ($rtic = $db->fetch($qtic))
		{
		?>
			<div style='display:inline-block;float:left;padding:5px;width:210px;'>
				<input type='checkbox' id='cbo_ti_<?=$rtic['id']?>' name='cbo_ti_<?=$rtic['id']?>' <?=(in_array($rtic['id'],$tien_ich))?"checked='checked'":""?> onchange='reload_tien_ich("<?=$rtic['id']?>")' />
				<label for="cbo_ti_<?=$rtic['id']?>"><?=$rtic['ten']?></label>
			</div>
		<?
		}
		?>
		<div style='clear:both'></div>
	</td>
</tr>
<?
}
?>
<style>
	.tr_border td
	{
		border:1px solid #ccc;
	}
</style>